<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Password</title>
<jsp:include page="/WEB-INF/jspf/header.jsp"></jsp:include>
<script>
function chkemail(f){
	np = f.T2.value;
	cp = f.T3.value;
	if(np != cp){
		document.getElementById("em").innerHTML = "<font color = blue> Password mismatch</font>"
		return false;
	}
}
         
         function shwStrength(f)
         {
         	        // 	console.log(f);
             var a = f.T2.value;
                      
                 if(a.length>4)
                  {
                     document.getElementById("pwd").innerHTML= "<font color=green> <u> Strong Password</u>";
                  }
                 else
                  {
                     document.getElementById("pwd").innerHTML="<font color=red> <u>Weak password</u>";     
                  } 
         }

</script>
</head>

<body class="metro">
	<div class="grid" style="padding-left: 15px;">
		<div class="row">
			<div class="span4">
				Welcome "${sessionScope.rslt.fname}"
				<div class="grid" style="padding-right: 20px;">
					<jsp:include page="/WEB-INF/jspf/leftmenu.jsp"></jsp:include>
				</div>
			</div>
			<div class="span8">
				<div class="div-header">
					<h3 class="head-title">Your account details</h3>
				</div>
				<form method="POST" action="pwdChange" onsubmit="return chkemail(this)">
	<table border="0" width="60%">
		<tr>
			<td>Current Password</td>
			<td><input type="password" name="T1" required="required" size="20"></td>
		</tr>
		<tr>
			<td>New Password</td>
			<td><input type="password" onkeyup="shwStrength(this.form)" required="required" name="T2" size="20"></td>
			<td><label id="pwd"> </label></td>
		</tr>
		<tr>
			<td>Confirm Password</td>
			<td><input type="password" name="T3" required="required" size="20"></td>
			<td><label id="em"></label></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type="submit" value="Submit" name="B1"></td>
		</tr>
	</table>
</form>

			</div>
		</div>
		<div class="row">
			<div class="span8 offset4">
				<div class="div-header">
					<%-- 					<h3 class="head-title">You have ${requestScope.msgsCount} mails in your mail box</h3> --%>
					<h3 class="head-title">You have ${sessionScope.msgsCount}
						mails in your mail box</h3>
				</div>
				<form action="delMessage" method="post">
					<table>
							<c:forEach var="msg" items="${sessionScope.msgs}">
							<tr>
								<td><input type="checkbox" data-show="intermediate"
									name="msgIds" value="${msg.id}" /></td>
								<td><a
										href="javascript:displayMessages('${msg.message}');return false;">
										${msg.teaser} ...</a></td>
										<td>&nbsp;</td>
								<td>${msg.time}</td>
								<td>&nbsp;</td>
								<% 
								//int id = session.get%>
								<td><a href="message.jsp?sid=${msg.sender}">Reply</a>
								</td>
								</tr>
							</c:forEach>
						<tr>
							<td><button type="submit" class="button small info">Delete</button></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</body>

</html>